<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>物联卡流量预警管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript" src="${ctxStatic}/common/base-loading.js"></script>
	<script type="text/javascript">
	$(document).ready(function() {
			$("#checkAll").click(function () {
				$("input[name='id']:checkbox").prop("checked", this.checked);            
			});
		});  
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/card/card/threshold_list");
			$("#searchForm").submit();
        	return false;
        }
		//清空
		function cleanForm(){
			 $(':input','#searchForm')
		       .not(':button,:submit,:reset,:hidden')
		       .val('')
		       .removeAttr('checked');
			 $(".select2-chosen").text("");
		       $.jBox.tip('清空成功。', 'success');
		}
		
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/card/card/threshold_list">卡列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="card" action="${ctx}/card/card/threshold_list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li style="margin-left:20px;"><label>运营商分类：</label>
				<form:select path="operator" class="input-medium" style="width:177px;">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('operator')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li style="margin-left:20px;"><label>品<span style="opacity:0;">啊啊啊</span>名：</label>
				<form:select path="brand" class="input-medium" style="width:177px;">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('brand')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li style="margin-left:20px;"><label>套 餐 类 型：</label>
				<form:select path="pkg" class="input-medium" style="width:177px;">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('pkg')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li style="margin-left:20px;"><label>卡<span style="opacity:0;">啊</span>类<span style="opacity:0;">啊</span>型：</label>
				<form:select path="cardType" class="input-medium" style="width:177px;">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('cardType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li style="margin-left:20px;"><label>状<span style="opacity:0;">啊啊啊</span>态：</label>
				<form:select path="cardStatus" class="input-medium" style="width:177px;">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('cardStatus')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
<%-- 			<li style="margin-left:20px;"><label>批<span style="opacity:0;">啊啊啊</span>次：</label>
				<form:input path="batchid" htmlEscape="false" maxlength="20" class="input-medium"/>
			</li> --%>
			<li style="margin-left:20px;"><label>编<span style="opacity:0;">啊啊啊</span>号：</label>
				<form:input path="phonenumber" htmlEscape="false" maxlength="20" class="input-medium"/>
			</li>
			<li style="margin-left:20px;"><label>ICCID&nbsp;&nbsp;(始)：</label>
				<form:input path="iccidStart" htmlEscape="false" maxlength="30" class="input-medium"/>
			</li>
			<li style="margin-left:20px;"><label>ICCID&nbsp;&nbsp;(止)：</label>
				<form:input path="iccidEnd" htmlEscape="false" maxlength="30" class="input-medium"/>
			</li>
<%-- 			<li style="margin-left:20px;"><label>激活时间：</label>
				<input name="createDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${card.createDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li>
			<li style="margin-left:20px;"><label>失效时间：</label>
				<input name="updateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${card.updateDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li> --%>
			<li style="margin-left:20px !important;" class="btns">
				<a id="btnSubmit" class="btn btn-primary"  onclick="return page();"><i class="icon-search"></i>&nbsp;查询</a>
			</li>
			<li style="margin-left:20px !important;" class="btns">
				<a id="btnSubmit" class="btn btn-warning" onclick="cleanForm();"><i class="icon-refresh"></i>&nbsp;清空</a>
			</li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable"  class="table  table-striped table-bordered table-condensed table-hover table-responsive" >
		<thead>
			<tr>
				<th><input type="checkbox" id="checkAll"/></th>
				<th>所属运营商</th>
				<th>品名</th>
				<th>套餐类型</th>
				<th>卡类型</th>
				<th>所属代理商</th>
				<th>编号</th>
				<th>ICCID</th>
				<th>卡状态</th>
				<th>资费计划</th>
				<th>本月用量（KB）</th>
				<th>流量阈值（MB）</th>
				<th>流量预警阈值</th>
				<th>激活时间</th>
				<th>失效时间</th>
			</tr>
		</thead>
		<tbody>
		<c:choose>
			<c:when test="${not empty page.list}">
				<c:forEach items="${page.list}" var="card">
					<tr>
						<td><input class="checkbox-hook" type="checkbox" name="id" value="${card.id}"/></td>
						<td>
							<c:if test="${card.operator == 1}">中国移动</c:if>
							<c:if test="${card.operator == 2}">中国电信</c:if>
							<c:if test="${card.operator == 3}">中国联通</c:if>
						</td>
						<td>
							<c:if test="${card.brand == 1}">全球通</c:if>
							<c:if test="${card.brand == 2}">神州行</c:if>
							<c:if test="${card.brand == 3}">动感地带</c:if>
						</td>
						<td>
							${fns:getDictLabel(card.pkg, 'pkg', '未知')}
						</td>
						<td>
							<c:if test="${card.cardType == 1}">标准</c:if>
							<c:if test="${card.cardType == 2}">Micro</c:if>
							<c:if test="${card.cardType == 3}">Nano</c:if>
						</td>
						<td>
							${card.office.name}
						</td>
						<td>
							${card.phonenumber}
						</td>
						<td>
							${card.iccid}
						</td>
						<td><span style="color:red;">超流量</span></td>
						<td></td>
						<td></td>
						<td></td>
						<td>
							${card.warning}
						</td>
						<td>
							<fmt:formatDate value="${noticeInfo.createDate}" pattern="yyyy-MM-dd"/>
						</td>
						<td>
							<fmt:formatDate value="${noticeInfo.updateDate}" pattern="yyyy-MM-dd"/>
						</td>
					</tr>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<tr>
					<td colspan="16" style="text-align: center;font-size:17px; font-family:SimHei">未查询到数据...</td>
				</tr>
			</c:otherwise>
			</c:choose>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>